package com.assistant.codegen.modules.template.domain;

import com.assistant.framework.BaseDomain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.*;
import java.util.List;

/**
 * 方案
 */
@EqualsAndHashCode(callSuper = true)
@ToString(exclude = "templates")
@Data
@Entity
@Table(name = "codegen_template_plan")
public class Plan extends BaseDomain<Plan> {

    /**
     * 方案名称
     */
    private String name;

    /**
     * 代码风格
     */
    @ManyToOne
    @JoinColumn(name = "codestyle_id", foreignKey = @ForeignKey(name = "none"))
    private CodeStyle codeStyle;

    /**
     * 包含的模版
     */
    @OneToMany
    @JoinColumn(name = "plan_id", foreignKey = @ForeignKey(name = "none"))
    private List<Template> templates;
}
